package cc.ipost.ipost.data;

import org.json.JSONException;
import org.json.JSONObject;

public class User {
	public String ID = null;
	public String fname = null;
	public String lname = null;
	public String email = null;
	public String pwd = null;
	public int count = 0;
	public int limit = 0;

	public User(String ID, String email, String pwd, String fname,
			String lname, int count, int limit) {
		this.ID = ID;
		this.email = email;
		this.pwd = pwd;
		this.fname = fname;
		this.lname = lname;
		this.count = count;
		this.limit = limit;
	}

	public User(JSONObject user) {
		try {
			this.ID = user.getString("id");
			this.email = user.getString("email");
			this.pwd = user.getString("pwd");
			this.fname = user.getString("fname");
			this.lname = user.getString("lname");
			this.count = user.getInt("count");
			this.limit = user.getInt("limit");
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public User(String ID) {
		this.ID = ID;
	}

}
